package lambda;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;

public class Test02 {

    @Test
    public void Test1() {
        List<Person> dataList = new ArrayList<>();
        dataList.add(new Person(30,"周瑞"));
        dataList.add(new Person(32,"小关"));
        dataList.add(new Person(6,"周灏宇"));
        dataList.add(new Person(1,"周灏昂"));
        dataList.add(new Person(10,"张三"));
        dataList.add(new Person(15,"李四"));
        dataList.removeIf(item -> (item.getAge() == 10 || item.getName().equals("李四")));
        System.out.println(dataList.toString());
        consumer.accept(dataList);
    }

    private Consumer consumer = new Consumer<List<String>>() {
        @Override
        public void accept(List<String> list) {
            System.out.println(list.stream());
        }

        @Override
        public Consumer andThen(Consumer after) {
            return null;
        }
    };
}
